
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
    color: #fff;
    min-height: 100vh;
    padding: 10px; /* 减小页面边距 */
    overflow: hidden; /* 隐藏滚动条 */
}

.container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 15px; /* 减小间距 */
    height: 95vh; /* 限制容器高度 */
}

.production-section {
    width: 80%;
    height: 100%; /* 设置高度 */
    display: flex;
    flex-direction: column;
}

.control-section {
    width: 20%;
    height: 100%; /* 设置高度 */
}

header {
    text-align: center;
    padding: 10px 0; /* 减小内边距 */
    margin-bottom: 10px; /* 减小外边距 */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 1.8rem; /* 减小字体大小 */
    margin-bottom: 5px; /* 减小外边距 */
    text-shadow: 0 0 10px #00eeff;
    background: linear-gradient(to right, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1rem; /* 减小字体大小 */
    opacity: 0.8;
}

.production-area {
    display: flex;
    justify-content: center;
    margin: 10px 0; /* 减小外边距 */
    position: relative;
    height: calc(100% - 180px); /* 计算剩余高度 */
    flex-grow: 1;
}

.outer-circle {
    width: 100%;
    max-width: 100%;
    height: 100%;
    border: 8px solid #4a4a8a;
    border-radius: 50%;
    position: relative;
    background: rgba(30, 30, 60, 0.7);
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.3);
    margin: 0 auto;
    aspect-ratio: 1 / 1; /* 确保是正圆形 */
}

.inner-circle {
    width: 55%; /* 使用百分比 */
    height: 55%; /* 使用百分比 */
    border: 8px solid #4a8a4a;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 60, 30, 0.7);
    box-shadow: 0 0 20px rgba(0, 255, 100, 0.3);
    aspect-ratio: 1 / 1; /* 确保是正圆形 */
}

.process-step {
    position: absolute;
    width: 100px;
    height: 45px;
    background: linear-gradient(to bottom, #3a3a6a, #2a2a4a);
    border: 2px solid #5a5a9a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    padding: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    cursor: default;
}

.process-step.outer {
    background: linear-gradient(to bottom, #3a3a6a, #2a2a4a);
    border-color: #5a5a9a;
}

.process-step.inner {
    background: linear-gradient(to bottom, #3a6a3a, #2a4a2a);
    border-color: #5a9a5a;
}

.process-step.active {
    box-shadow: 0 0 15px #00eeff, inset 0 0 10px #ffffff;
    transform: scale(1.1);
    z-index: 10;
}

.process-step.active.outer {
    background: linear-gradient(to bottom, #4a4a9a, #3a3a7a);
    border-color: #7a7aff;
}

.process-step.active.inner {
    background: linear-gradient(to bottom, #4a9a4a, #3a7a3a);
    border-color: #7aff7a;
}

.process-step.waiting {
    background: linear-gradient(to bottom, #6a6a3a, #4a4a2a);
    border-color: #9a9a5a;
}

.process-step.painting {
    background: linear-gradient(to bottom, #6a3a6a, #4a2a4a);
    border-color: #9a5a9a;
}

.process-step.drying {
    background: linear-gradient(to bottom, #3a6a6a, #2a4a4a);
    border-color: #5a9a9a;
}

.step-index {
    font-size: 10px;
    opacity: 0.7;
}

.step-name {
    font-size: 12px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-id {
    font-size: 10px;
    color: #4facfe;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(79, 172, 254, 0.7);
    height: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.control-panel {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 15px;
    height: 100%; /* 占满容器高度 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    border: 1px solid #4a4a8a;
    display: flex;
    flex-direction: column;
}

.panel-title {
    text-align: center;
    font-size: 1.3rem; /* 减小字体大小 */
    margin-bottom: 15px; /* 减小外边距 */
    color: #4facfe;
    text-shadow: 0 0 8px rgba(79, 172, 254, 0.7);
}

.input-group {
    display: flex;
    margin-bottom: 15px; /* 减小外边距 */
}

#orderInput {
    flex: 1;
    padding: 10px; /* 减小内边距 */
    font-size: 0.9rem; /* 减小字体大小 */
    border: 2px solid #4a4a8a;
    border-radius: 8px 0 0 8px;
    background: rgba(30, 30, 60, 0.8);
    color: white;
    outline: none;
}

#queryBtn {
    padding: 10px 15px; /* 减小内边距 */
    font-size: 0.9rem; /* 减小字体大小 */
    background: linear-gradient(to right, #4facfe, #00f2fe);
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.status-display {
    background: rgba(30, 30, 60, 0.8);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    flex-grow: 0;
    height: 500px; /* 进一步减小高度 */
    border: 2px solid #4a4a8a;
    margin-bottom: 15px; /* 减小外边距 */
    overflow: hidden;
    display: table-cell; /* 使vertical-align生效 */
    vertical-align: middle; /* 垂直居中 */
}

#orderStatus {
    font-size: 0.9rem; /* 减小字体大小 */
    padding: 5px;
    height: 100%;
    word-wrap: break-word;
    overflow: hidden;
    white-space: normal; /* 允许正常换行 */
    display: block; /* 确保作为块级元素显示 */
    vertical-align: middle;
    text-align: left;
}

/* 时间轴样式 */
.timeline {
    position: relative;
    padding: 20px 0;
    overflow-y: auto;
    max-height: 400px;
}

/* 美化滚动条 */
.timeline::-webkit-scrollbar {
    width: 8px;
}

.timeline::-webkit-scrollbar-track {
    background: rgba(30, 30, 60, 0.5);
    border-radius: 4px;
}

.timeline::-webkit-scrollbar-thumb {
    background: #4a4a8a;
    border-radius: 4px;
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: #5a5a9a;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4a4a8a;
    left: 15px;
    margin-left: -2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 15px;
    padding-left: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4facfe;
    left: 5px;
    top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.timeline-badge.outer {
    background: #5a5a9a;
}

.timeline-badge.inner {
    background: #5a9a5a;
}

.timeline-panel {
    background: rgba(40, 40, 80, 0.7);
    border: 1px solid #4a4a8a;
    border-radius: 5px;
    padding: 10px;
    position: relative;
}

.timeline-panel::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -10px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #4a4a8a;
}

.timeline-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #4facfe;
}

.timeline-time {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 3px;
}

.timeline-duration {
    font-size: 0.8rem;
    color: #888;
}

.current-process {
    background: rgba(79, 172, 254, 0.3);
    border-color: #4facfe;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* 减小间距 */
    margin-top: 10px; /* 减小外边距 */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 48%;
}

.legend-color {
    width: 12px; /* 减小尺寸 */
    height: 12px; /* 减小尺寸 */
    border-radius: 3px;
}

.outer-legend {
    background: linear-gradient(to bottom, #3a3a6a, #2a2a4a);
    border: 1px solid #5a5a9a;
}

.inner-legend {
    background: linear-gradient(to bottom, #3a6a3a, #2a4a2a);
    border: 1px solid #5a9a5a;
}

.active-legend {
    background: linear-gradient(to bottom, #4a4a9a, #3a3a7a);
    border: 1px solid #7a7aff;
    box-shadow: 0 0 5px #00eeff;
}

.waiting-legend {
    background: linear-gradient(to bottom, #6a6a3a, #4a4a2a);
    border: 1px solid #9a9a5a;
}

.painting-legend {
    background: linear-gradient(to bottom, #6a3a6a, #4a2a4a);
    border: 1px solid #9a5a9a;
}

.drying-legend {
    background: linear-gradient(to bottom, #3a6a6a, #2a4a4a);
    border: 1px solid #5a9a9a;
}

.simulation-controls {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 减小间距 */
    margin-top: 10px; /* 减小外边距 */
}

.simulation-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.control-btn {
    flex: 1; /* 均匀分配宽度 */
    padding: 8px 12px; /* 减小内边距 */
    font-size: 0.8rem; /* 减小字体大小 */
    background: rgba(30, 30, 60, 0.8);
    border: 2px solid #4a4a8a;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap; /* 防止文字换行 */
}

.control-btn:hover {
    background: rgba(79, 172, 254, 0.3);
    border-color: #4facfe;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.machine {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #ff5555;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff0000, inset 0 0 5px #ffffff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.machine.outer-machine {
    background: #5555ff;
    box-shadow: 0 0 10px #0000ff, inset 0 0 5px #ffffff;
}

.machine.inner-machine {
    background: #55ff55;
    box-shadow: 0 0 10px #00ff00, inset 0 0 5px #ffffff;
}

footer {
    text-align: center;
    padding: 10px; /* 减小内边距 */
    font-size: 0.8rem; /* 减小字体大小 */
    opacity: 0.7;
    margin-bottom: 0px;
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    
    .production-section,
    .control-section {
        width: 100%;
    }
    
    .production-area {
        height: 500px;
    }
    
    .outer-circle {
        width: 90vw;
        height: 90vw;
        max-width: 500px;
        height: 500px;
    }
    
    .inner-circle {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    .process-step {
        width: 70px;
        height: 50px;
        font-size: 10px;
    }
    
    .legend-item {
        width: 100%;
    }
}

/* 增加工序名称之间的间距 */
.outer-process {
    margin-right: 20px; /* 增加工序名称之间的间距 */
}

.inner-process {
    margin-left: 20px; /* 增加工序名称之间的间距 */
}

/* 显示右侧底部的“示例”内容 */
.example-section {
    display: block; /* 确保示例部分可见 */
    margin-top: 20px; /* 添加顶部间距 */
}

/* 新增订单号显示样式 */
.order-id {
    font-size: 10px;
    color: #ffcc00;
    margin-top: 0px;
    text-align: center;
}

/* 新增待进入区域样式 */
.waiting-area {
    position: absolute;
    top: -50px; /* 调整顶部距离 */
    left: 20px; /* 调整左侧距离 */
    width: 150px;
    height: 120px;
    background: linear-gradient(to bottom, #969191, #e7dbda);
    border: 2px solid #f39c12;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.transfer-area {
    position: absolute;
    top: calc(50% - 80px); /* 调整顶部距离 */
    left: calc(50% - 85px); /* 调整左侧距离 */
    width: 180px;
    height: 150px;
    background: linear-gradient(to bottom, #969191, #e7dbda);
    border: 2px solid #f39c12;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.completed-orders {
    font-size: 12px;
    font-weight: normal;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
    width: 90%;
    text-align: center;
}

.order-item {
    color: #e74c3c;
    font-weight: bold;
    padding: 2px 0;
}

/* 新增连接线样式 */
.connection-line {
    stroke: #f39c12;
    stroke-width: 2;
}

/* 调整工序名称的间距 */
.outer-process {
    margin-right: 20px; /* 增加工序名称之间的间距 */
}

.inner-process {
    margin-left: 20px; /* 增加工序名称之间的间距 */
}

/* 显示右侧底部的“示例”内容 */
.example-section {
    display: block; /* 确保示例部分可见 */
    margin-top: 20px; /* 添加顶部间距 */
}